<?php
/**
 * User: b179a9
 * Date: 9/20/11
 * Time: 5:57 PM
 */

class Zend_View_Helper_Rubrics extends Zend_View_Helper_Abstract
{

    public function rubrics($rubrics)
    {
        $output = '<ul>';
        foreach ($rubrics as $rubric) {
            $output .= "<li id=\"{$rubric['id']}\">";
            $output .= "<a href=\"#\">{$rubric['name']}</a> ";
            $output .= $rubric['name'];
            if (array_key_exists('children',$rubric) && count($rubric['children'])) {
                $output .= $this->rubrics($rubric['children']);
            }
            $output .= '</li>';
        }
        $output .= '</ul>';
        return $output;
    }

}
